<?php
 ini_set('display_errors', '1');
error_reporting(E_ALL);

/* include the classes */
include "include/class.utils.php";
include "include/class.session.php";
include "include/class.route.php";
include "include/class.api.php";
include "include/class.user.php";
include "include/class.cursor.php";
include "include/class.database.php";
include "include/class.filesystem.php";

// new Api class
$objSession = new Session();
$objApi = new Api();
$objUser = new User();
$objDatabase = new Database();

/* include the api functions */
include "api.filesystem.php";
include "api.user.php";

//get the path
$strPath = $_SERVER["REQUEST_URI"];
if(strpos($strPath, "?")) {
	$strPath = strstr($strPath, "?", true);
}
//get the method
$strMethod = strtoupper($_SERVER["REQUEST_METHOD"]);

//execute the api calls
$objApi->execute($strMethod, $strPath);
?>